package la.iok.hzsvn.lewin.movie.core.model;

import java.util.Date;
import java.util.Objects;

/**
 * 剧本信息
 * @since 1.0
 */
public class MovieVo extends MovieBase {
    /**
     * 创建剧本的用户id.只有创建剧本的人才可以修改剧本
     */
    private Long userId;
    /**
     * 名称
     */
    private String name;
    /**
     * 封面图
     */
    private String cover;
    /**
     * 剧本手册文件路径,相对剧本根目录。doc文档
     */
    private String assist;
    /**
     * 剧本手册的文件存储路径,相对剧本根目录，是html文件
     */
    private String assistHtml;
    /**
     * 版本
     */
    private String version;
    /**
     * 剧本实例id.如果是发布的剧本版本对象，则此值为对应的版本实例的id
     */
    private Long movieInstanceId;
    /**
     * 发布时间。只有实例对象才会有值
     */
    private Date publishTime;
    /**
     * 剧本等级id
     */
    private Long movieLevelId;
    /**
     * 标记剧本文件是否已经删除。删除剧本实例的剧本文件,对剧本引用的所有文件引用计数减1，并将引用剧本文件的每个子表对象都标记为文件已经删除。
     * 0：默认值，未删除；1：已删除
     * @since 1.1.1
     */
    private Integer fileDeleted;
    /**
     * 剧本开放价格
     */
    private Integer openPrice;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getAssist() {
        return assist;
    }

    public void setAssist(String assist) {
        this.assist = assist;
    }

    public String getAssistHtml() {
        return assistHtml;
    }

    public void setAssistHtml(String assistHtml) {
        this.assistHtml = assistHtml;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public Long getMovieInstanceId() {
        return movieInstanceId;
    }

    public void setMovieInstanceId(Long movieInstanceId) {
        this.movieInstanceId = movieInstanceId;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public Long getMovieLevelId() {
        return movieLevelId;
    }

    public void setMovieLevelId(Long movieLevelId) {
        this.movieLevelId = movieLevelId;
    }

    public Integer getFileDeleted() {
        return fileDeleted;
    }

    public void setFileDeleted(Integer fileDeleted) {
        this.fileDeleted = fileDeleted;
    }

    public Integer getOpenPrice() {
        return openPrice;
    }

    public void setOpenPrice(Integer openPrice) {
        this.openPrice = openPrice;
    }

    /**
     * @since 1.1.1
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof MovieVo)) return false;
        if (!super.equals(o)) return false;
        MovieVo movieVo = (MovieVo) o;
        return Objects.equals(userId, movieVo.userId) && Objects.equals(name, movieVo.name) && Objects.equals(cover, movieVo.cover)
                && Objects.equals(assist, movieVo.assist) && Objects.equals(assistHtml, movieVo.assistHtml)
                && Objects.equals(version, movieVo.version) && Objects.equals(publishTime, movieVo.publishTime)
                && Objects.equals(movieLevelId, movieVo.movieLevelId) && Objects.equals(fileDeleted, movieVo.fileDeleted)
                && Objects.equals(openPrice, movieVo.openPrice) && Objects.equals(movieInstanceId, movieVo.movieInstanceId);
    }

    /**
     * @since 1.1.1
     */
    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), userId, name, cover, assist, assistHtml, version, publishTime,
                movieLevelId, fileDeleted, openPrice, movieInstanceId);
    }

    /**
     * @since 1.1.1
     */
    @Override
    public String toString() {
        return "MovieVo{" +
                "userId=" + userId +
                ", name='" + name + '\'' +
                ", cover='" + cover + '\'' +
                ", assist='" + assist + '\'' +
                ", assistHtml='" + assistHtml + '\'' +
                ", version='" + version + '\'' +
                "movieInstanceId=" + movieInstanceId +
                ", publishTime=" + publishTime +
                ", movieLevelId=" + movieLevelId +
                ", fileDeleted=" + fileDeleted +
                ", openPrice=" + openPrice +
                "} " + super.toString();
    }
}
